/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: atp
 * Date: 2022-11-04
 * Time: 16:28
 */
public class Test {

    public static void main(String[] args) {
        String str = "abcdefbcd";
//        for (int i = 0; i < str.length(); i++) {
//            char ch = str.charAt(i);
//            System.out.println(ch);
//        }
        System.out.println(str.indexOf('b'));
        System.out.println(str.indexOf('c',3));
        System.out.println(str.indexOf("abc"));
        System.out.println(str.indexOf("abc",4));
        System.out.println(str.lastIndexOf('c'));
    }

    public static void main1(String[] args) {
        String str1 = "牛的";
        String str2 = new String("牛的");
        char[] chars = {'n','d'};
        String str3 = new String(chars);
    }
}
